package Service;

import Dao.ProjectMapper;
import Entity.Custom;
import Entity.Project;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProjectService implements IProjectService {

    @Autowired
    private ProjectMapper projectMapper;


    @Override
    public int deleteByPrimaryKey(Long id) {
        return projectMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Project record) {
        return projectMapper.insert(record);
    }

    @Override
    public int insertSelective(Project record) {
        return projectMapper.insertSelective(record);
    }

    @Override
    public Project selectByPrimaryKey(Long id) {
        return projectMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Project> selectByPrimaryKeyOffset(int start, int offset) {
        return projectMapper.selectByPrimaryKeyOffset(new Custom(start,offset));
    }

    @Override
    public int updateByPrimaryKeySelective(Project record) {
        return projectMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKeyWithBLOBs(Project record) {
        return projectMapper.updateByPrimaryKeyWithBLOBs(record);
    }

    @Override
    public int updateByPrimaryKey(Project record) {
        return projectMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Project> getAllProjectTitle() {
        return projectMapper.getAllProjectTitle();
    }

    @Override
    public List<Project> searchProject(String index) {
        return projectMapper.searchProject(index);
    }

    @Override
    public int getAllProjectCount() {
        return projectMapper.getAllProjectCount();
    }

    @Override
    public String selectMaxProjectNum() {
        return projectMapper.selectMaxProjectNum();
    }

    @Override
    public List<String> getProjectByType(String type) {
        return projectMapper.getProjectByType(type);
    }
}
